//
// Created by postgres on 4/19/17.
//

#ifndef MYDATASTRUCTURES_STACKLINK_H
#define MYDATASTRUCTURES_STACKLINK_H
#include "../common/common.h"
#define SeqStackMAXSIZE 20
typedef int ElemType;/* ElemType类型根据实际情况而定，这里假设为int */
typedef struct SeqStackNode {
    ElemType data[SeqStackMAXSIZE];        /* 数组，存储数据元素 */
    int top;                                /* stack当前长度 */
} SeqStackNode;
typedef SeqStackNode *SeqStack;

typedef int ElemType;/* ElemType类型根据实际情况而定，这里假设为int */
typedef struct StackNodeLink{
    ElemType data;
    struct StackNodeLink *next;
}StackNodeLink;
typedef StackNodeLink *StackLink;
Status InitStackLink(StackLink *head);
Status StackLinkEmpty(StackLink head);
Status PushStackLink(StackLink *head,ElemType e);
extern void StackLink_Test();
Status InitSeqStack(SeqStackNode *s);
Status GetTop(SeqStackNode s,ElemType *e);
Status PushStack(SeqStackNode *s,ElemType e);
Status PopStack(SeqStackNode *s,ElemType *e);
Status ClearStack(SeqStackNode *s);
Status StackLength(SeqStackNode s);

extern void SeqStack_Test();
#endif //MYDATASTRUCTURES_STACKLINK_H
